package com.haidao.admin.component.configuration.properties;

import org.springframework.stereotype.Component;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

@Component
public class CssConfigProperties {
    // 读取resource目录的下的cssconfig.properties文件
    private Properties properties;
    public Properties getConfig() {
        if (properties == null) {
            Properties properties = new Properties();
            try (InputStream input = getClass().getClassLoader().getResourceAsStream("cssconfig.properties")) {
                if (input == null) {
                    throw new IOException("Unable to find cssconfig.properties");
                }
                properties.load(input);
            } catch (IOException ignored) {

            }
            this.properties = properties;
            return properties;
        }
        return properties;
    }

}
